#include<stdio.h>
#include<stdlib.h>
int main(void)
{
	int years,month,day;
	
	FILE *fp1,*fp2;

	if((fp1=fopen("D:\\date.txt","w+"))==NULL)
	{
		printf("File open error!");
		exit(0);
	}
	scanf("%d/%d/%d",&month,&day,&years);
	
	fprintf(fp1,"%d/%d/%d",month,day,years);
	
	if(fclose(fp1))
	{
		printf("Can not close the file\n");
			exit(0);
	}
		if((fp2=fopen("D:\\myfiles\\date.txt","w+"))==NULL)
	{
		printf("File open error!");
		exit(0);
	}
	fscanf(fp1,"%d%d%d",&day,&month,&years);
	
	printf("%4d.%d.%2d\n",years,month,day);

	if(fclose(fp2))
	{
		printf("Can not close the file\n");
			exit(0);
	}
	return 0;
}


